const api = {
	// 提货部分的接口
	pickUpCloudWarehouse: '/server-users-out-orders/pickUpCloudWarehouse',
	deletePickup: '/server-users-out-orders/deleteCanceledInOrder',
	cancelPickup: '/server-users-out-orders/cancelInOrder',
	// 获取当前用户所有提货订单
	getPickupList: '/server-users-out-orders/getUserOutOrders',
	//获取当前用户提货订单详情
	getPickListDetail: '/server-users-out-orders/getUserOneOutOrders',
	// 提货部分的去收货
	toReceiveGoods: '/server-users-out-orders/serverConfirmReceipt',

	toPay: '/pay/payOutOrderFreightMoney',


	//云仓补货的接口
	//提交打款凭证
	submitPayment: '/server-user-orders/submitPaymentVoucher',
	//增加服务商订单
	addServerUserOrders: '/server-user-orders/addServerUserOrders',
	//删除已取消的订单
	deleteReplishOrder: '/server-user-orders/deleteCanceledInOrder',
	//取消订单
	cancelReplishOrder: '/server-user-orders/cancelInOrder',
	//获取当前用户所有补货订单级订单详情
	getUserRelishOrders: '/server-user-orders/getUserInOrders'


};

// 云仓提货
export const pickUpCloudWarehouse = (data) => {
	return uni.$http.post(api.pickUpCloudWarehouse, data);
};

// 相当于就是云仓补货
export const addServerUserOrders = (data) => {
	return uni.$http.post(api.addServerUserOrders, data);
};


// 删除已取消的提货订单
export const deletePickup = (id) => {
	return uni.$http.get(`${api.deletePickup}/${id}`);
};

// 取消提货订单
export const cancelPickup = (data) => {
	return uni.$http.post(api.cancelPickup, data);
};

// 获取当前用户所有提货订单
export const getPickupList = () => {
	return uni.$http.get(api.getPickupList);
};

// 获取当前用户提货订单详情
export const getPickListDetail = (id) => {
	return uni.$http.get(`${api.getPickListDetail}/${id}`);
};

export const toReceiveGoods = (id) => {
	return uni.$http.get(`${api.toReceiveGoods}/${id}`);
};

//提货去支付运费
export const toPay = (outOrderId) => {
	return uni.$http.get(`${api.toPay}/${outOrderId}`);
}


// 提交打款凭证
export const submitPayment = (data) => {
	return uni.$http.post(api.submitPayment, data);
};

// 删除已取消的补货订单
export const deleteReplishOrder = (id) => {
	return uni.$http.get(`${api.deleteReplishOrder}/${id}`);
};

// 取消补货订单
export const cancelReplishOrder = (data) => {
	return uni.$http.post(api.cancelReplishOrder, data);
};

// 获取当前用户所有补货订单及订单详情
export const getUserRelishOrders = () => {
	return uni.$http.get(api.getUserRelishOrders);
};